package com.whale.cloud.util.mybatis;

import org.apache.ibatis.session.ExecutorType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.io.Resource;

/** Created by Abel on 2017/6/12. */
@ConfigurationProperties(prefix = MybatisProperties.MYBATIS_PREFIX)
public class MybatisProperties {

  public static final String MYBATIS_PREFIX = "mybatis";

  /** Config file path. */
  private String config;

  /** Location of mybatis mapper files. */
  private Resource[] mapperLocations;

  /** Package to scan domain objects. */
  private String typeAliasesPackage;

  /** Package to scan handlers. */
  private String typeHandlersPackage;

  /** Check the config file exists. */
  private boolean checkConfigLocation = false;

  /** Execution mode. */
  private ExecutorType executorType = ExecutorType.SIMPLE;

  public String getConfig() {
    return this.config;
  }

  public void setConfig(String config) {
    this.config = config;
  }

  public Resource[] getMapperLocations() {
    return this.mapperLocations;
  }

  public void setMapperLocations(Resource[] mapperLocations) {
    this.mapperLocations = mapperLocations;
  }

  public String getTypeHandlersPackage() {
    return this.typeHandlersPackage;
  }

  public void setTypeHandlersPackage(String typeHandlersPackage) {
    this.typeHandlersPackage = typeHandlersPackage;
  }

  public String getTypeAliasesPackage() {
    return this.typeAliasesPackage;
  }

  public void setTypeAliasesPackage(String typeAliasesPackage) {
    this.typeAliasesPackage = typeAliasesPackage;
  }

  public boolean isCheckConfigLocation() {
    return this.checkConfigLocation;
  }

  public void setCheckConfigLocation(boolean checkConfigLocation) {
    this.checkConfigLocation = checkConfigLocation;
  }

  public ExecutorType getExecutorType() {
    return this.executorType;
  }

  public void setExecutorType(ExecutorType executorType) {
    this.executorType = executorType;
  }
}
